import numpy as np
import matplotlib.pyplot as plt
from sklearn import manifold, datasets
import pylab

S = np.loadtxt("data/source_5000_feature.txt")
# T = np.loadtxt("seadap-awtarget-aw0.txt")


# ST = np.row_stack((S, T))
print(len(S))
# print(len(T))
# X = ST

tsne = manifold.TSNE(n_iter= 3000, perplexity=35, n_components=2, init='pca', random_state=501)
Y = tsne.fit_transform(S)


pylab.scatter(Y[0:len(S), 0], Y[0:len(S), 1], 5, c='blue')
# pylab.scatter(Y[len(S):len(S)+len(T), 0], Y[len(S):len(S)+len(T), 1], 5, c='red')
pylab.show()

print('done')